﻿using LogicModel.DataModel;
using LogicModel.ViewModel;
using MappingDTO.Admin;
using System;
using ToolsModel;

namespace MappingDTO.Configure
{
    public class AdminConfigure : BaseConfigure
    {
        [Obsolete]
        protected override void Configure()
        {
            //CreateMap<Tsource, Tdestin>();

            CreateMap<View_SysUserRoleView, AdminTicket>()
                .ForMember(p => p.Code, opt => { opt.MapFrom(t => t.Code); })
                .ForMember(p => p.LoginName, opt => { opt.MapFrom(t => t.LoginName); })
                .ForMember(p => p.UserName, opt => { opt.MapFrom(t => t.UserName); })
                .ForMember(p => p.State, opt => { opt.MapFrom(t => t.State); })
                .ForMember(p => p.Phone, opt => { opt.MapFrom(t => t.Phone); })
                .ForMember(p => p.Sex, opt => { opt.MapFrom(t => t.Sex); })
                .ForMember(p => p.CreateTime, opt => { opt.MapFrom(t => t.CreateTime); })
                .ForMember(p => p.RoleCodes, opt => { opt.MapFrom(t => t.RoleCodes); })
                ;

            CreateMap<SysUserEntity, SysUserRetDTO>()
               .ForMember(p => p.Code, opt => { opt.MapFrom(t => t.Code); })
               .ForMember(p => p.LoginName, opt => { opt.MapFrom(t => t.LoginName); })
               .ForMember(p => p.UserName, opt => { opt.MapFrom(t => t.UserName); })
               .ForMember(p => p.State, opt => { opt.MapFrom(t => t.State); })
               .ForMember(p => p.Phone, opt => { opt.MapFrom(t => t.Phone); })
               .ForMember(p => p.Sex, opt => { opt.MapFrom(t => t.Sex); })
               .ForMember(p => p.IsDeleted, opt => { opt.MapFrom(t => t.IsDeleted);
               });

            CreateMap<SysMenuEntity, SysMenuRetDTO>();



        }
    }
}
